/*
package generate;

import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Slf4j
public class TradeMySqlTypeConvert extends MySqlTypeConvert {

    @Override
    public DbColumnType processTypeConvert(GlobalConfig globalConfig, String fieldType) {
        log.info("转换类型：" + fieldType);
        // tinyint转换成Boolean
        if (fieldType.toLowerCase().contains("tinyint")) {
            return DbColumnType.INTEGER;
        }
        // 将数据库中datetime转换成date
        if (fieldType.toLowerCase().contains("datetime")) {
            return DbColumnType.DATE;
        }
        // 将数据库中date转换成date
        if (fieldType.toLowerCase().contains("date")) {
            return DbColumnType.DATE;
        }
        // 将数据库中blob转换成byte[]
        if (fieldType.toLowerCase().contains("blob")) {
            return DbColumnType.BYTE_ARRAY;
        }
        return (DbColumnType) super.processTypeConvert(globalConfig, fieldType);
    }
}
*/
